package main

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"runtime"
	"strings"
)

func main() {

	r := gin.Default()

	r.GET("/healthz", func(c *gin.Context) {
		for key, value := range c.Request.Header {
			var build strings.Builder
			for _, value2 := range value {
				build.WriteString(value2)
			}
			c.Header(key, build.String())
		}
		c.Header("VERSION", runtime.Version())
		fmt.Println("ip:", c.Request.RemoteAddr)
	})
	//监听端口默认为8080
	r.Run(":8080")
}
